signature TREE =
sig
  structure Node :
  sig
    type 'a t
    
    val addSuccessor : 'a t * 'a t -> unit
    val content : 'a t -> 'a
    val equals : 'a t * 'a t -> bool
    val new : 'a -> 'a t
    val successors : 'a t -> 'a t list
  end
  
  type 'a t
  
  val addEdge : 'a t * {from : 'a Node.t, to : 'a Node.t} -> unit
  val addNode : 'a t * 'a Node.t -> unit
  val foreachNode : 'a t -> ('a Node.t -> unit) -> unit
  val hasEdge : 'a t * {from : 'a Node.t, to : 'a Node.t} -> bool
  val new : unit -> 'a t
  val newNode : 'a t * 'a -> 'a Node.t
  val nodes : 'a t -> 'a Node.t list
  val numNodes : 'a t -> int
  val toDot : 'a t * string * ('a Node.t -> string) -> unit
end